<?
require("config.php");

$label = "Catalog List";

$table="med_catalog";

	$Query="SELECT 
	id,
	code,
	name,
	file 
	FROM $table ORDER BY id DESC";

	$r=myQuery($Query);

require($rela_path . "inc/header1.php");
?>
<br>
<br>

<script language="javascript">
function fillForm(Catalog){
opener.form2.Catalog.value=Catalog;
top.close();
}
</script>

<table width="90%" border="0" align="center" cellpadding="1" cellspacing="1" class="tb">   
<tr class="tbheader"> 
    <td width="5%"> 
      <div align="center">No.</div>
    </td>
    <td width="69%"> 
      <div align="center">Title</div>
    </td>
    <td width="26%"> 
      <div align="center">File</div>
    </td>
  </tr>


<?
if ($r){	
	for ($i=0;$i<count($r);$i++){?>
  <tr class="tbcontent1"> 
    <td align="right"><?print($i+1)?></td>
    <td>

	<?if ($fillform){?>
<a href="#" onClick="fillForm(<?print("'" . $r[$i][2] . "'")?>)"><?print($r[$i][2])?></a>
	<?}else{?>
	<?print($r[$i][2])?>
	<?}?>	
	
	</td>
    <td align="center"><a href="<?print($rela_path . $PIC_DIR . $table)?>/<?print($r[$i][3])?>" target="_blank"><?print($r[$i][3])?></a></td>
  </tr>
<?}
}?>


</table>
<br>
<br>
<?
require($rela_path . "inc/footer1.php");
?>
